package com.nwpu.bigdata.controller;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.nwpu.bigdata.model.Metric;
import com.nwpu.bigdata.service.MetricService;

/**
 *@version:2018年8月12日下午8:39:35
*/
/**
 * @author Administrator
 *
 */

@RestController
@RequestMapping("/metric")
public class MetricController {
	private static Logger logger = LoggerFactory.getLogger(LogController.class);
	@Autowired
	MetricService metricService;
	@RequestMapping(value = "/allMetricName", method = {RequestMethod.GET}, produces = "application/json;charset=UTF-8") // 限制請求方式為get
	public @ResponseBody List<Metric> cpuQuery(ModelAndView modelAndView) throws Exception {
		List<Metric> list = metricService.getAllMetricName();
		return list;
	}
}
